<script setup lang="ts">
import { ref } from "vue";
import { useRouter, RouterView, RouterLink, useRoute } from "vue-router";
// import zhCn from "element-plus/es/locale/lang/zh-cn"; // 中文包
// import en from "element-plus/es/locale/lang/en"; // 英文包
// import { useI18n } from "vue-i18n";
import CommonHeader from "./components/layout/commonHeader.vue"; // 头部组件
import CommonFooter from "./components/layout/commonFooter.vue"; // 底部组件
import { useStore } from "@/store";

// const { locale: localeLanguage } = useI18n(); // 定义别名
// const router = useRouter();
// const route = useRoute();
// const locale = ref(zhCn);
// const changeLang = (lang: any) => {
//   locale.value = lang;
//   localeLanguage.value = lang.name;
// };
const route = useRoute();
const store = useStore();

</script>

<template>
  <el-config-provider :locale="store.state.locale">
    <!-- 头部 -->
    <CommonHeader v-show="route.fullPath.indexOf('login') === -1"></CommonHeader>
    <!-- 主体 -->
    <div class="container">
      <RouterView></RouterView>
    </div>
    <!-- 底部 -->
    <CommonFooter v-show="route.fullPath.indexOf('login') === -1"></CommonFooter>
  </el-config-provider>
</template>

<style scoped lang="scss">
@import "@/assets/scss/main.scss";
</style>
